<template>
  <div>
    <div>
      <button @click="loveTalkStore.getNewTalk">获取数据</button>
    </div>
    <ul>
      <li v-for="{ id, msg } of talks" :key="id">
        {{ msg }}
      </li>
    </ul>
  </div>
</template>

<script setup lang="ts">
import { storeToRefs } from "pinia";
import { useLoveTalkStore } from "../store";

const loveTalkStore = useLoveTalkStore();
const { talks } = storeToRefs(loveTalkStore);
</script>

<style scoped></style>
